package com.hkccommunity.mapper;

import com.hkccommunity.entity.AnswerChild;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AnswerChildMapper {

    @Select("select * from answer_child where answer_parent_id = #{parentId} and `delete` = 0;")
    @ResultMap("answerChildResultMap")
    List<AnswerChild> getAnswerByParentId(@Param("parentId") Long parentId);

    @Insert("insert into answer_child values (#{answerParentId},#{replyContent},#{acceptUser},#{createUser},#{createTime},#{like},#{delete})")
    int addAnswerChild(AnswerChild child);
}
